//
//  YTKNetConfig.m
//  YTKNetworkEncapsulation
//  Created by tianXin on 16/9/1.
//
//

#import "YTKNetConfig.h"
#import "YTKNetworkConfig.h"
#import "YTKNetworkAgent.h"

@implementation YTKNetConfig

+ (NSString *)config:(YTKSever)sever{
    //改变网络请求的一些配置
    YTKNetworkAgent *agent = [YTKNetworkAgent sharedAgent];
    [agent setValue:[NSSet setWithObjects:@"application/json", @"text/plain", @"text/javascript", @"text/json",@"text/html",@"text/css", nil] forKeyPath:@"_manager.responseSerializer.acceptableContentTypes"];
    YTKNetworkConfig *config = [YTKNetworkConfig sharedConfig];
    NSString *msg = @"";
    switch (sever) {
        case SeverDEV:     // 开发服务器地址
            config.baseUrl = @"http://61.152.104.174:89/api/";
            msg = [NSString stringWithFormat:@"开发网%@",config.baseUrl];
            break;
        case SeverTEST:     //测试服务器地址
            config.baseUrl = @"http://61.152.104.174:89/api/";
//            config.baseUrl = @"http://61.152.104.174:82/api/";
            msg = [NSString stringWithFormat:@"测试网%@",config.baseUrl];
            break;
        case SeverRELEASE:   //发布版服务器地址
            config.baseUrl = @"http://61.152.104.174:82/api/";
            msg = [NSString stringWithFormat:@"外网%@",config.baseUrl];
            break;
        default:
            break;
    }
    DDLog(@"\n\n%@\n\n",msg);
    return msg;
}


@end
